import { Module } from '@nestjs/common';
import { AvatarController } from './controllers/avatar.controller';
import { AppUploadModule } from '@/app/modules/upload/app-upload.module';
import { AvatarProviders } from './providers/avatar.provider'
import { CreateAvatarCommandHandler } from './commands/create-avatar.command.handler'
import { GetUserAvatarQueryHandler } from './queries/get-user-avatar.query.handler'
import { ConfigService } from '@nestjs/config'
import { AvatarService } from './providers/avatar.service';
import { ImageModule } from '@/image/image.module'
import { AvatarCreateEventHandler } from './events/create-avatar.event.handler'

const commandHandlers = [CreateAvatarCommandHandler]
const queryHnadlers = [GetUserAvatarQueryHandler]
const services = [ConfigService, AvatarService]
const eventHandlers = [AvatarCreateEventHandler]
@Module({
  imports: [AppUploadModule.register({
    destination: "UPLOAD.avatar"
  }),
    ImageModule
  ],
  controllers: [AvatarController],
  providers: [...AvatarProviders, ...commandHandlers, ...queryHnadlers, ...services, ...eventHandlers]
})
export class AvatarModule { }
